package com.y2w.gulimall.seckill.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

//@EnableAsync //org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration
@Slf4j
@Component
//@EnableScheduling //org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration
public class HelloSchedule {

    /**
     * 在spring中6位组成，不允许第七位
     * 周几按顺序不用加1
     * 默认阻塞
     *  1.异步编排
     *  2.定时任务线程池 TaskSchedulingProperties:spring.task.scheduling.pool.size=5(没成)
     *  3.@EnableAsync @Async
     */
    //@Async
    //@Scheduled(cron = "* * * ? * 2")
    public void hello() throws InterruptedException {
        log.info("hello");
        Thread.sleep(3000);

    }
}
